3.2.8 \(\int \frac {a+b x^2}{1-x^2} \, dx\) [108]

Optimal. Leaf size=11 \[ -b x+(a+b) \tanh ^{-1}(x) \]

[Out]

-b*x+(a+b)*arctanh(x)

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {396, 212} \begin {gather*} (a+b) \tanh ^{-1}(x)-b x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*x^2)/(1 - x^2),x]

[Out]

-(b*x) + (a + b)*ArcTanh[x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rubi steps

\begin {align*} \int \frac {a+b x^2}{1-x^2} \, dx &=-b x-(-a-b) \int \frac {1}{1-x^2} \, dx\\ &=-b x+(a+b) \tanh ^{-1}(x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(28\) vs. \(2(11)=22\).
time = 0.01, size = 28, normalized size = 2.55 \begin {gather*} \frac {1}{2} (-2 b x-(a+b) \log (1-x)+(a+b) \log (1+x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x^2)/(1 - x^2),x]

[Out]

(-2*b*x - (a + b)*Log[1 - x] + (a + b)*Log[1 + x])/2

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(31\) vs. \(2(11)=22\).
time = 0.08, size = 32, normalized size = 2.91

method result size
meijerg \(\frac {i b \left (2 i x -2 i \arctanh \left (x \right )\right )}{2}+a \arctanh \left (x \right )\) \(20\)
norman \(-b x +\left (-\frac {a}{2}-\frac {b}{2}\right ) \ln \left (x -1\right )+\left (\frac {a}{2}+\frac {b}{2}\right ) \ln \left (x +1\right )\) \(30\)
default \(-b x +\frac {\left (-a -b \right ) \ln \left (x -1\right )}{2}-\frac {\left (-a -b \right ) \ln \left (x +1\right )}{2}\) \(32\)
risch \(-b x -\frac {\ln \left (x -1\right ) a}{2}-\frac {\ln \left (x -1\right ) b}{2}+\frac {\ln \left (x +1\right ) a}{2}+\frac {\ln \left (x +1\right ) b}{2}\) \(34\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^2+a)/(-x^2+1),x,method=_RETURNVERBOSE)

[Out]

-b*x+1/2*(-a-b)*ln(x-1)-1/2*(-a-b)*ln(x+1)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 23 vs. \(2 (11) = 22\).
time = 0.28, size = 23, normalized size = 2.09 \begin {gather*} -b x + \frac {1}{2} \, {\left (a + b\right )} \log \left (x + 1\right ) - \frac {1}{2} \, {\left (a + b\right )} \log \left (x - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(-x^2+1),x, algorithm="maxima")

[Out]

-b*x + 1/2*(a + b)*log(x + 1) - 1/2*(a + b)*log(x - 1)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 23 vs. \(2 (11) = 22\).
time = 1.06, size = 23, normalized size = 2.09 \begin {gather*} -b x + \frac {1}{2} \, {\left (a + b\right )} \log \left (x + 1\right ) - \frac {1}{2} \, {\left (a + b\right )} \log \left (x - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(-x^2+1),x, algorithm="fricas")

[Out]

-b*x + 1/2*(a + b)*log(x + 1) - 1/2*(a + b)*log(x - 1)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 22 vs. \(2 (8) = 16\).
time = 0.08, size = 22, normalized size = 2.00 \begin {gather*} - b x - \frac {\left (a + b\right ) \log {\left (x - 1 \right )}}{2} + \frac {\left (a + b\right ) \log {\left (x + 1 \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x**2+a)/(-x**2+1),x)

[Out]

-b*x - (a + b)*log(x - 1)/2 + (a + b)*log(x + 1)/2

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 25 vs. \(2 (11) = 22\).
time = 1.42, size = 25, normalized size = 2.27 \begin {gather*} -b x + \frac {1}{2} \, {\left (a + b\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{2} \, {\left (a + b\right )} \log \left ({\left | x - 1 \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/(-x^2+1),x, algorithm="giac")

[Out]

-b*x + 1/2*(a + b)*log(abs(x + 1)) - 1/2*(a + b)*log(abs(x - 1))

________________________________________________________________________________________

Mupad [B]
time = 0.06, size = 11, normalized size = 1.00 \begin {gather*} \mathrm {atanh}\left (x\right )\,\left (a+b\right )-b\,x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(a + b*x^2)/(x^2 - 1),x)

[Out]

atanh(x)*(a + b) - b*x

________________________________________________________________________________________